//! @Author: DengLibin
//! @Date: Create in 2023-12-19 14:44:52
//! @Description: 结巴分词器

use std::sync::Arc;

use jieba_rs::Jieba;

/// @Author: DengLibin
/// @Date: Create in 2023-12-19 15:02:57
/// @Description: 分词
pub fn cut<'a>(jieba: Arc<Jieba>, sentence: &'a str) -> Vec<&'a str> {
    return jieba.cut(sentence, true);
}


/// @Author: DengLibin
/// @Date: Create in 2023-12-19 15:03:46
/// @Description: 分词 返回所有可能的词
pub fn cut_all<'a>(jieba: Arc<Jieba>, sentence: &'a str) -> Vec<&'a str> {
    jieba.cut_all(sentence)
}

/// @Author: DengLibin
/// @Date: Create in 2023-12-19 15:04:37
/// @Description: 分词 搜索模式
pub fn cut_for_search<'a>(jieba: Arc<Jieba>, sentence: &'a str) -> Vec<&'a str> {
    jieba.cut_for_search(sentence, false)
}


